import React,{ useEffect } from 'react'
import { useDispatch, useSelector } from 'react-redux'
// import { RootState } from '../stroe'
import { getNewsList } from '../stroe/action/newList'
import avator from '../assets/cat.jpg'
//  
export default function NewsList() {
  const dispatch=useDispatch()
  // const channelsList=useSelector((state:RootState)=>state.channels.channelList)
  // console.log( channelsList);
  // const channelID=useSelector((state:RootState)=>state.channels.activeID)
  // console.log(channelID);
  useEffect(()=>{
     // 获取文章列表数据
     function getNews() {
         dispatch(getNewsList())
     }
     getNews()
  },[dispatch])
  return (
      <div className="list">
        <div className="article_item">
          <h3 className="van-ellipsis">python数据预处理 ：数据标准化</h3>
          <div className="img_box">
            <img src={avator} className="w100" alt="" />
          </div>
          <div className="info_box">
            <span>13552285417</span>
            <span>0评论</span>
            <span>2018-11-29T17:02:09</span>
          </div>
        </div>
      </div>
    )
}